import {network} from "./network.js"


Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
// movieList: "https://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items",
// tvList: "https://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items",
// showList: "https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items",
// movieDetail: "https://m.douban.com/rexxar/api/v2/movie/",
// tvDetail: "https://m.douban.com/rexxar/api/v2/tv/",
// showDetail: "https://m.douban.com/rexxar/api/v2/tv/",
    // 电影
    network.getMovieList({success:function(movies){
      that.setData({
        movies: movies
      })
    }})
    // 电视剧
    network.getTvList({
      success: function (tvs) {
        that.setData({
          tvs: tvs
        })
      }
    })
    // 综艺
    network.getShowList({
      success: function (shows) {
        that.setData({
          shows: shows
        })
      }
    })
  }

})